package com.rdk.service.impl;


import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.rdk.dao.BaseDao;
import com.rdk.service.BaseService;
import com.rdk.utils.Page;

/**
 * Created by 褰�on 2015/5/4.
 */
@Service
public class BaseServiceImpl<PkEntity> implements BaseService<PkEntity> {
    @Autowired
    private BaseDao<PkEntity> baseDao;
    
    @Override
    public void save(PkEntity pkEntity) {
        baseDao.save(pkEntity);
    }

    @Override
    public void update(PkEntity pkEntity) {
        baseDao.update(pkEntity);
    }

    @Override
    public void delete(Long id) {
        baseDao.delete(id);
    }

    @Override
    public PkEntity load(Long id) {
        return baseDao.load(id);
    }

    @Override
    public List<PkEntity> loadAll(Map<String, Object> maps) {
        return baseDao.loadAll(maps);
    }


    @Override
    public PkEntity load(String id)
    {
        return baseDao.load(id);
    }

    @Override
    public void delete(String id)
    {
    baseDao.delete(id);
    }

    @Override
    public int deleteByPrimaryKey(String id)
    {
        return baseDao.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(PkEntity t)
    {
        return baseDao.insert(t);
    }

    @Override
    public int insertSelective(PkEntity t)
    {
        return baseDao.insert(t);
    }

    @Override
    public PkEntity selectByPrimaryKey(String id)
    {
        return baseDao.selectByPrimaryKey(id);
    }

    @Override
    public int updateByPrimaryKeySelective(PkEntity t)
    {
        return baseDao.updateByPrimaryKey(t);
    }

    @Override
    public int updateByPrimaryKey(PkEntity t)
    {
        return baseDao.updateByPrimaryKey(t);
    }

	@Override
	public int deleteKeywordByRid(String rule_id) {
		return baseDao.deleteKeywordByRid(rule_id);
	}

	@Override
	public int deleteFodderByRid(String rule_id) {
		return baseDao.deleteFodderByRid(rule_id);
	}

	@Override
	public List<Map<String, Object>> selectRuleById(String id) {
		return baseDao.selectRuleById(id);
	}

	@Override
	public Map<String, Object> findKeywordById(String id) {
		return baseDao.findKeywordById(id);
	}

	@Override
	public List<Map<String, Object>> selectRuleByType(Map<String, String> map) {
		return baseDao.selectRuleByType(map);
	}

	@Override
	public Integer queryPageCount(Map<String, Object> maps) {
		// TODO Auto-generated method stub
		return baseDao.queryPageCount(maps);
	}

	@Override
	public PkEntity load(Map<String,Object> maps) {
		// TODO Auto-generated method stub
		return baseDao.load(maps);
	}
	
	@Override
    public Page<PkEntity> queryPage(Integer currentIndex,Integer pageNum,Map<String,Object> maps) {
        return  new Page<PkEntity>(baseDao, currentIndex, pageNum, maps);
    }


}
